package housing.task3.dto;

import housing.task3.dto.PK.HsWorktypePk;

import java.io.Serializable;

public class HsWorktype implements Serializable {
    /**
     * This attribute maps to the column workType_id in the HS_WorkType table.
     */
    protected int worktypeId;

    /**
     * This attribute maps to the column name in the HS_WorkType table.
     */
    protected String name;

    /**
     * Method 'HsWorktype'
     */
    public HsWorktype() {
    }

    /**
     * Method 'getWorktypeId'
     *
     * @return int
     */
    public int getWorktypeId() {
        return worktypeId;
    }

    /**
     * Method 'setWorktypeId'
     *
     * @param worktypeId
     */
    public void setWorktypeId(int worktypeId) {
        this.worktypeId = worktypeId;
    }

    /**
     * Method 'getName'
     *
     * @return String
     */
    public String getName() {
        return name;
    }

    /**
     * Method 'setName'
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsWorktype)) {
            return false;
        }

        final HsWorktype _cast = (HsWorktype) _other;
        if (worktypeId != _cast.worktypeId) {
            return false;
        }

        if (name == null ? _cast.name != name : !name.equals(_cast.name)) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + worktypeId;
        if (name != null) {
            _hashCode = 29 * _hashCode + name.hashCode();
        }

        return _hashCode;
    }

    /**
     * Method 'createPk'
     *
     * @return HsWorktypePk
     */
    public HsWorktypePk createPk() {
        return new HsWorktypePk(worktypeId);
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("housing.task3.dto.HsWorktype: ");
        ret.append("worktypeId=" + worktypeId);
        ret.append(", name=" + name);
        return ret.toString();
    }

}
